package com.ruoyi.project.myexperiment.service;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.project.myexperiment.domain.DetailsDto;
import com.ruoyi.project.myexperiment.domain.MyExment;
import com.ruoyi.project.myexperiment.mapper.MyExmentMapper;
import com.ruoyi.project.system.user.domain.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class MyExmentServiceImpl implements MyExmentService {
    @Autowired
    private MyExmentMapper myExmentMapper;

    @Override
    public List<MyExment> selectExmentList(MyExment myExment) {
        return myExmentMapper.selectExmentList(myExment);
    }

    @Override
    public DetailsDto seletExmentDetail(String id) {
        return myExmentMapper.seletExmentDetail(id);
    }


    @Override
    public DetailsDto seletExmentDetail2(HashMap<String,Long> id) {
        return myExmentMapper.seletExmentDetail2(id);
    }


    /**
     * 取消发布
     *
     * @return
     */
    @Override
    public int quxiaoFabu(HashMap<String, Object> map) {
        return myExmentMapper.quxiaoFabu(map);
    }



    /**
     * 提交实验
     *
     * @param detailsDto
     * @return
     */
    @Override
    public boolean insertDetail(DetailsDto detailsDto) {
        return myExmentMapper.insertDetail(detailsDto);
    }

    @Override
    public boolean updateDetail(DetailsDto detailsDto) {
        return myExmentMapper.updateDetail(detailsDto);
    }

    @Override
    public List<DetailsDto> seletExmentDetail1(int id) {
        return myExmentMapper.seletExmentDetail1(id);
    }


    /**
     * 插入成绩
     *
     * @param detailsDto
     * @return
     */
    @Override
    public boolean insertDetailtwo(DetailsDto detailsDto) {
        return myExmentMapper.insertDetailtwo(detailsDto);
    }


    /**
     * 插入文件路径
     */
    @Override
    public boolean insertFileInfo(DetailsDto file) {
        return myExmentMapper.insertFileInfo(file);
    }


    /**
     * 根據實驗所選擇的資源查詢對應的網址
     */
    @Override
    public List<String> getPathbyAccessoryId(String[] accessory) {
        return myExmentMapper.getPathbyAccessoryId(accessory);
    }


    /**
     * 插入文件路径  ，若果该学生没有提交该实验的话
     */
   /* @Override
    public boolean insertDetailDao(DetailsDto detailsDto) {
        return myExmentMapper.insertDetailDao(detailsDto);
    }


    *//**
     * 查询表中是否有此数据
     * @param detailsDto
     * @return
     *//*
    @Override
    public boolean getById(DetailsDto detailsDto) {
        return myExmentMapper.getById(detailsDto);
    }
*/
}
